<%@page import="com.cn.dao.ReplyDao"%>
<%@page import="com.cn.entity.User"%>
<%@page import="com.cn.dao.UserDao"%>
<%@page import="com.cn.entity.Messages"%>
<%@page import="java.util.List"%>
<%@page import="com.cn.dao.MessageDao"%>
<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>北京医院</title>
</head>
<body>
<h5>
留言
</h5>
<%MessageDao md=new MessageDao();
 List<Messages>list=md.scanAll();
for (int i=0;i<list.size();i++)    {
 	Messages message=list.get(i);
%>


<div >
时间：<%=message.getDate() %>
<br>
发帖人：<%int userid=message.getUserid();UserDao ud=new UserDao();User user=ud.scanOne(userid); %>
<%=user.getUsername() %>
<br>
主题：<a href="messagedetail.jsp?messageid=<%=message.getMessageid()%>"><%=message.getTopic() %> </a>
<br>
回复数量：<%ReplyDao ry=new ReplyDao(); %>
</div>

<%} %>
<a href="messageadd.jsp"><button>写留言</button></a>
</body>
</html>